#!/bin/bash

# http://graphs.grevian.org/graph/ con esto grafican
let "first=1"
cat "$@" |
while read -r line
do
        if [[ $first == 1 ]] ; 
	then 
		echo  "graph{ 
			rankdir=LR;";
		
		let "first=0"
	else
	echo $line | sed -nr 's/([0-9]+)\s([0-9]+)\s([0-9]+)\s([0-9]+)/ \1 -- \2 [label="w1=\3  w2=\4"];/p'	
	fi	
done
echo "}";
